<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>出院登记</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
</head>
<style>
    .layui-input-block {
        width: 260px;
        height: 20px;
    }

    .layui-btn {
        margin-left: 600px;
        margin-top: 0px;
    }

    #layui-btn {
        margin-left: 730px;
        margin-top: -55px;
    }
</style>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item"><h1>出院登记</h1></div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名:</label>
            <div class="layui-input-block">
                <input type="text" name="username" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">科室</label>
            <div class="layui-input-inline" style="width:260px">
                <select name="departName" lay-verify="required" lay-search="">
                    <option value="">请选择</option>
                    <option value="1">呼吸内科</option>
                    <option value="2">消化内科</option>
                    <option value="3">心内科</option>
                    <option value="4">血液科</option>
                    <option value="5">小儿科</option>
                    <option value="6">内分泌科</option>
                    <option value="7">神经内科</option>
                    <option value="8">感染科</option>
                    <option value="9">骨科</option>
                    <option value="10">神经外科</option>
                    <option value="11">肝胆外科</option>
                    <option value="12">烧伤科</option>
                    <option value="13">妇科</option>
                    <option value="14">产科</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">身份证号:</label>
            <div class="layui-input-block">
                <input type="text" name="idName" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">主治医师:</label>
            <div class="layui-input-block">
                <input type="text" name="doctorId" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">入院时间:</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" id="test1" placeholder="yyyy-MM-dd">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">病房号:</label>
            <div class="layui-input-block">
                <input type="text" name="roomId" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
<!--        <div class="layui-inline">
            <label class="layui-form-label">是否结算:</label>
            <div class="layui-input-block">
                <input type="text" name="" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>-->
        <div class="layui-inline">
            <label class="layui-form-label">床位号:</label>
            <div class="layui-input-block">
                <input type="text" name="bedId" lay-verify="required"
                       lay-reqtext="必填项不能为空" placeholder="请输入" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">查询</button>
            <button type="reset" class="layui-btn layui-btn-primary" id="layui-btn">重置</button>
        </div>
    </div>
</form>
<script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/jquery-1.12.2.min.js" type="text/javascript"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        laydate.render({
            elem: '#test1'
        });



        $.ajax({
            type: "get",
            url: "hospital/user/out.do",
            dataType: "json",
            success: function (data) {
                console.log(data);
                if (data.code == 1) {
                    $("#idName").html(data.info.idName);
                } else {
                    layer.msg("获取数据异常")
                }
            }
        })

        //监听提交
        form.on('submit(demo1)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
    });
</script>
</body>
</html>